#define checkbox(x)
    <label style="margin-top:5px;">
		<input id="_#(x.index??)_chb" type="checkbox" #(x.checked??) #(disabled??) class="minimal">
	</label>
	<input type="hidden" id="_#(x.index??)" name="#(table??x.table).#(x.index??)" value="#(x.value??0)">
	<link rel="stylesheet" href="/static/assets/iCheck/all.css">
	<script src="/static/assets/iCheck/icheck.min.js"></script>
	<script type="text/javascript">
	    function _#(x.index??)_initcheckbox(value){
	    	 if(value == undefined)value = "#(x.value??0)";
	    	 $('input[type="checkbox"].minimal').iCheck({
			      checkboxClass: 'icheckbox_minimal-blue',
			      radioClass   : 'iradio_minimal-blue'
			 })
			 if(value == "1"){
					$("#_#(x.index??)_chb").iCheck('check');
			 }
			 else if(value == "0"){
				    $("#_#(x.index??)_chb").iCheck('uncheck');
			 }
			 $('#_#(x.index??)_chb').on('ifChanged', function(obj){
			        if(obj.currentTarget.checked){
			        	$("#_#(x.index??)").val("1");
			        }else{
			        	$("#_#(x.index??)").val("0");
			        }
			 })
	    }
	</script>
#end